// %action-invoked signal with @id as a parameter
addButton: function(id, label) {
if (!this._buttonBox) {
-
let box = new St.BoxLayout({ style_class: 'notification-actions' });
this.setActionArea(box, { x_expand: false,
y_expand: false,
y_fill: false,
x_align: St.Align.END });
this._buttonBox = box;
+ global.focus_manager.add_group(this._buttonBox);
}
let button = new St.Button({ can_focus: true });
button.label = label;
}
- if (this._buttonBox.get_n_children() > 0)
- global.focus_manager.remove_group(this._buttonBox);
-
this._buttonBox.add(button);
- global.focus_manager.add_group(this._buttonBox);
button.connect('clicked', Lang.bind(this, this._onActionInvoked, id));
this.updated();